package com.yz.vi.commons.result;

/**
 * @description:
 * @author: yutingting
 * @create: 2021-01-22 10:01
 **/
public class Page {
    public static Integer DEFAULT_PAGESIZE = 10;
    private Integer pageNumber;
    private Integer pageSize;

    public Page() {
        this.pageSize = DEFAULT_PAGESIZE;
    }

    public Integer getPageNumber() {
        return this.pageNumber;
    }

    public Integer getPageSize() {
        return this.pageSize;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Page)) {
            return false;
        } else {
            Page other = (Page)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$pageNumber = this.getPageNumber();
                Object other$pageNumber = other.getPageNumber();
                if (this$pageNumber == null) {
                    if (other$pageNumber != null) {
                        return false;
                    }
                } else if (!this$pageNumber.equals(other$pageNumber)) {
                    return false;
                }

                Object this$pageSize = this.getPageSize();
                Object other$pageSize = other.getPageSize();
                if (this$pageSize == null) {
                    if (other$pageSize != null) {
                        return false;
                    }
                } else if (!this$pageSize.equals(other$pageSize)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof Page;
    }

    public int hashCode() {
        int result = 1;
        Object $pageNumber = this.getPageNumber();
        result = result * 59 + ($pageNumber == null ? 43 : $pageNumber.hashCode());
        Object $pageSize = this.getPageSize();
        result = result * 59 + ($pageSize == null ? 43 : $pageSize.hashCode());
        return result;
    }

    public String toString() {
        return "Page(pageNumber=" + this.getPageNumber() + ", pageSize=" + this.getPageSize() + ")";
    }
}
